34/57

# hdfs.setroot

Sets the HDFS root directory.

Usage

    hdfs.setroot(dfs.root)

Arguments

dfs.root

  The full path in HDFS to be set as the current root directory. If this argument is omitted, then your HDFS home directory is used as the root.

Usage Notes

Use `hdfs.root` to see the current root directory.

All HDFS paths and operations using Oracle R Connector for Hadoop are relative to the current HDFS root. You cannot change the current working directory above the root directory. Users do not have write access to the HDFS / directory, which is the default HDFS root directory.

Return Value

The full path to the newly set HDFS root directory, or NULL if an error prevented a new root directory from being set

Example

This example changes the HDFS root directory from /user/oracle to /user/oracle/demo.

    R> hdfs.root()
    [1] "/user/oracle"
    R> hdfs.setroot("/user/oracle/demo")
    R> hdfs.root()
    [1] "/user/oracle/demo"